import Vue from 'vue'
import VueRouter from 'vue-router'

const Index = () => import('../views/Index.vue');   //按需加载

Vue.use(VueRouter);

//路由表
const routes = [
  {
    path: '/',        
    name: 'Index',    
    component: Index  
  },
  {
      path:'/toDetail',
      name:'Detail',
      component:() => import('../views/Detail.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router